import 'package:enterprise_v6_app/app/components/custom_app_bar.dart';
import 'package:enterprise_v6_app/app/core/core.dart';
import 'package:enterprise_v6_app/app/modules/task/task_all/education/me_demand_research/me_demand_research_detail/findings/findings_view.dart';
import 'package:enterprise_v6_app/app/modules/task/task_all/education/me_demand_research/me_demand_research_detail/findings_text/findings_text_view.dart';
import 'package:enterprise_v6_app/app/modules/task/task_all/education/me_demand_research/me_demand_research_detail/foundation_info/foundation_info_view.dart';
import 'package:enterprise_v6_app/app/modules/task/task_all/education/me_demand_research/me_demand_research_detail/me_demand_research_detail_controller.dart';
import 'package:enterprise_v6_app/app/modules/task/task_all/education/me_demand_research/me_demand_research_detail/select_theme_tree/regional_organization_tree_view.dart';

///需求调研详情（我的）
class MeDemandResearchDetailPage extends StatelessWidget {
  MeDemandResearchDetailPage({super.key});

  final controller = Get.put(MeDemandResearchDetailController());

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: CustomAppBar(
        titleText: '详情',
      ),
      body: Container(
        color: AppColors.bg_color_grey,
        child: DefaultTabController(
          length: Get.arguments['isShow'] as bool ? 3 : 2,
          initialIndex: controller.initPage,
          child: Column(
            children: [
              Container(
                padding: EdgeInsets.symmetric(horizontal: 30.w),
                decoration: BoxDecoration(
                  color: Colors.white,
                  borderRadius: BorderRadius.circular(8),
                ),
                height: 54.w,
                child: Get.arguments['isShow'] as bool
                    ? TabBar(
                        enableFeedback: false,
                        tabs: const [
                          Tab(text: '基础信息'),
                          Tab(text: '可选主题'),
                          Tab(text: '调研结果'),
                        ],
                        dividerColor: Colors.transparent,
                        labelPadding: EdgeInsets.only(bottom: 10.w),
                        labelStyle: TextStyle(
                          fontSize: 16.sp,
                          fontWeight: FontWeight.w500,
                        ),
                        unselectedLabelStyle: TextStyle(
                          fontSize: 16.sp,
                          fontWeight: FontWeight.w500,
                        ),
                        labelColor: Colors.black,
                        unselectedLabelColor: const Color(0xffA0A7B5),
                        indicatorPadding: EdgeInsets.only(top: 36.w, bottom: 10.w),
                        indicator: const BoxDecoration(
                          image: DecorationImage(
                            image: AssetImage(
                              AppImages.icon_app_work_plan,
                            ),
                          ),
                        ),
                      )
                    : TabBar(
                        enableFeedback: false,
                        tabs: const [
                          Tab(text: '基础信息'),
                          Tab(text: '可选主题'),
                        ],
                        dividerColor: Colors.transparent,
                        labelPadding: EdgeInsets.only(bottom: 10.w),
                        labelStyle: TextStyle(
                          fontSize: 16.sp,
                          fontWeight: FontWeight.w500,
                        ),
                        unselectedLabelStyle: TextStyle(
                          fontSize: 16.sp,
                          fontWeight: FontWeight.w500,
                        ),
                        labelColor: Colors.black,
                        unselectedLabelColor: const Color(0xffA0A7B5),
                        indicatorPadding: EdgeInsets.only(top: 36.w, bottom: 10.w),
                        indicator: const BoxDecoration(
                          image: DecorationImage(
                            image: AssetImage(
                              AppImages.icon_app_work_plan,
                            ),
                          ),
                        ),
                      ),
              ),
              Expanded(
                child: Container(
                  color: const Color(0xffF5F5F6),
                  child: Get.arguments['isShow'] as bool
                      ? TabBarView(
                          children: [
                            //基础信息
                            FoundationInfoPage(),
                            SelectThemeTreePage(),
                            Get.arguments['isText'] as bool ? FindingsPage() : FindingsTextPage(),
                            // Get.arguments['isText'] as bool ? FindingsTextPage() : FindingsPage(),
                          ],
                        )
                      : TabBarView(
                          children: [
                            //基础信息
                            FoundationInfoPage(),
                            SelectThemeTreePage(),
                            // Get.arguments['isText'] as bool ? FindingsTextPage() : FindingsPage(),
                          ],
                        ),
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
